package cn.iocoder.yudao.framework.common.enums;

import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 文章类型枚举
 *
 * @author admin
 */
@Getter
@AllArgsConstructor
public enum ArticleTypeEnum implements ArrayValuable<Integer> {

    ARTICLE(0, "文章"),
    POPUP(1, "弹窗"),
    ;

    public static final Integer[] ARRAYS = Arrays.stream(values()).map(ArticleTypeEnum::getType).toArray(Integer[]::new);

    /**
     * 类型值
     */
    private final Integer type;
    /**
     * 类型名
     */
    private final String name;

    @Override
    public Integer[] array() {
        return ARRAYS;
    }

    public static boolean isArticle(Integer type) {
        return ARTICLE.type.equals(type);
    }

    public static boolean isPopup(Integer type) {
        return POPUP.type.equals(type);
    }
} 